#ifndef MAIN_H
#define MAIN_H

#include <pcrctransformation/pcrctransformer.hpp>
#include <pcrctransformation/point2f.hpp>

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <unicap_cv_bridge.hpp>

using namespace cv;
using namespace unicap_cv_bridge;
using namespace std;
using namespace pcrctransformation;

struct CrateData {
	int* crate_info;
	int* crate_info_red;
	int* crate_info_green;
	int* crate_info_blue;
	
	double width;
	double height;
	double depth;
	
	int col_nr;
	int row_nr;
	double offset;
	double degree;
	double median;
	
	double distance_to_side;
	double distance_to_next;
	double centre_to_centre;
	
	double container_width;
	double container_height;
	
	
	double middle_x;
	double middle_y;
};

struct ContentData {
	Mat* box;

	int* ball_hue_low;
	int* ball_hue_high;
	int diff_colors;
	 
	int empty_hue_low;
	int empty_hue_high;
	int border_saturation;
};

struct EnvData {
	double cam_pheight;
	double cam_rheight;
	double cam_rx;
	double cam_ry;
	double cam_px;
	double cam_py;
	
	pc_rc_transformer* cordTransformer;
};

struct VisionData {
	CrateData crateData;
	CrateData robotCrateData;
	ContentData contentData;
	EnvData envData;
};

VisionData* getVisionData();

point2f single_perspective_adjustment(point2f src, bool real);

void draw_box(Mat& dst, int x1, int y1, int x2, int y2, Scalar color);
#endif
